<%@ page  language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ page import="com.hz.supermanage.bean.HtmlBean,com.hz.supermanage.dao.Constants,
	org.apache.commons.lang.StringUtils,java.util.*,com.hz.framework.util.BusinessException" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<jsp:useBean id="dao" class="com.hz.supermanage.dao.ProgramaDao" />
<%
    String userPk = request.getParameter("userPk");
    //String highLight = request.getParameter("highLight");
    //String type = request.getParameter("type");
    Map emUser = new HashMap();
    String orgname =  "";
    try {
        if (StringUtils.isBlank(userPk)) {
         throw new BusinessException("用户标识不能为空");
        }
        emUser = dao.getPersonSelect(userPk);
        String orgid = (String) emUser.get("orgid").toString();
        orgname = (String) dao.getOrgNameSelect(orgid);
        dao.RqsetRole("all",request);
    }catch(Exception ex) {
        throw new BusinessException("失败", ex);
    }
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>系统权限设置</title>
<META http-equiv=Content-Type content=text/html;charset=UTF-8>
   <meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
<link href="${pageContext.request.contextPath}/parts/CSS/mail.css" rel="stylesheet" type="text/css">
<link href="${pageContext.request.contextPath}/parts/CSS/base.css" rel="stylesheet" type="text/css"/>
<link href="${pageContext.request.contextPath}/parts/CSS/lb.css" rel="stylesheet" type="text/css"/>
<script type='text/javascript' src='${pageContext.request.contextPath}/dwr/interface/ajax.js'></script>
<script type='text/javascript' src='${pageContext.request.contextPath}/dwr/engine.js'></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/parts/framejs/common/validate.js"></script>
<script src="${pageContext.request.contextPath}/parts/itemjs/supermanage/setup/Juice.js"></script>
<!--<script src="${pageContext.request.contextPath}/parts/itemjs/supermanage/roleGrama/TreeMouseMenu.js"></script>-->
<!--<script src="${pageContext.request.contextPath}/parts/itemjs/supermanage/roleGrama/Control.js"></script>-->
<script src="${pageContext.request.contextPath}/parts/itemjs/supermanage/roleGrama/roleGrama.js"></script>
<style rel="stylesheet" type="text/css"> 
.treeCb {
	font-family: Tahoma;
	padding:0px;
	height:0px;
	font-size:10px;
	width:14px;
	height:14px;
	margin-left:2px;
}
.NodeName {
  font-size:12px;
}
.NodeName span,div{
  font-size:12px;
}
</style>
<script type="text/javascript">
//用户角色权限初始化
//这里FatherTreeC.xml中的接口方法会调用此方法
function ATree_loaded(){
	var urid = __get("userRid").value; //人员的角色id
	var ugid = __get("userGid").value; //人员的权限id
	gainValueCheck(document,"roleid",",",urid);
	gainValueCheck(document,"gramaCkeck",",",ugid);
}
</script>
</head>
<body style="overflow: hidden" onselectstart="return false">
<form method="post" action="">
<div style='overflow:hidden;padding:7 10 7 0' align="right">
<INPUT class="btn" type="button" value="保存用户" title="保存用户权限" onclick="doSaveGR('P')" style='cursor:hand;'>&nbsp;&nbsp;
<!--<INPUT class="btn" type="button" value="保存角色" title="保存角色权限" onclick="doSaveGR('R')" style='cursor:hand;'>&nbsp;&nbsp;-->
<INPUT class="btn" type="button" value="关闭窗口" title="关闭窗口" onclick="parent.__close()" style='cursor:hand'>
</div>
<div tt.impl=WABody style='overflow-y:auto;height: 100%;width: 100%;'>
<input type=hidden name='userPk' value="<%=emUser.get("personid")%>">
<input type=hidden name='userRid' value="<%=emUser.get("roleid")%>">
<input type=hidden name='userGid' value="<%=emUser.get("gramaid")%>">
<table style='background-color:#CFEBA5;width:100%' cellpadding=3><tr><td><img src='${pageContext.request.contextPath}/parts/images/img/infoxp.gif' align=absbottom>
用户姓名：<span class=value><%=emUser.get("personname")%></span>&nbsp;&nbsp;&nbsp;&nbsp;用户名：<span class=value><%=emUser.get("loginid")%></span>
<br>&nbsp;&nbsp;&nbsp;&nbsp;所在：<span class=value><%=orgname %> -> <%=emUser.get("deptid")==null?"":emUser.get("deptid")%> -> <%=emUser.get("posid")==null?"":emUser.get("posid")%></span>
</td></tr></table>

<table width=100% cellspacing=0 cellpadding=0>
<tr>
<td style='padding:5px;width: 35%' align="center">
<div style='overflow-y:auto;height: 100%;width: 100%;padding:5 5 5 5' align="left">
<c:forEach items="${list}" var="rows">
<span class="RoleSpan" onmouseout="doMsOut()" onmouseover="doMsOver()" onclick='doshowGrama(this)'>
<input type="hidden" name='grama' value="${rows.rolegrama }"><input type="checkbox" name='roleid' value="${rows.roleid }" onclick='doclickRole(this)'> ${rows.rolename }
</span><br>
</c:forEach>
</div>
</td>

<td style='padding:5px;width: 65%'>

<%--<span style='display:none' id=EXI_COMPONENT tt.ins.name="insOrgSelector"></span>
<input type='text' name='orgid' value='' tt.comment=''>
<div id=COMP_DeptM_PanelOrgSelector style='display:none;background-color:#eeeeee;border-color:#aaaaaa;border-style:groove;border-width:2px' >
<div tt.impl="FatherTree" tt.src="xml/pro_xml.jsp" tt.instance=OrgSelector style='overflow:auto;height:158' tt.lazy=true></div>
</div>--%>

<%=HtmlBean.getSmoothBegin()%>
<div tt.impl="FatherTreeC" tt.src="xml/pros_xml.jsp" tt.instance='ATree' id=COMP style='width:100%;overflow-y:auto;height:390;' ></div>
<%=HtmlBean.getSmoothEnd()%>

</td></tr></table>
</div>
</form>
    </body>
    </html>